<template>
  <div class="box">
    <p>
      <span>用户名：</span>
      <span><input type="text" placeholder="注册用户名" v-model="val"/></span>
    </p>
    <p>
      <span>密 &nbsp;&nbsp;&nbsp;码：</span>
      <span><input type="text" placeholder="输入密码"/></span>
    </p>
    <button @click="fun()">注册</button>
  </div>
</template>

<script>
export default {
  data(){
     return {
       val:""
     }
  },
  watch:{
    val(val){
     this.$store.commit("uptext",{newtxt:val})
    }
  },
  methods:{
    fun(){
      this.$router.push("/wode")
    }

  }
};
</script>

<style scoped>
.box {
  margin-top: 0.5rem;
  margin-left: 0.5rem;
}
.box p:nth-child(2) {
  margin-top: 0.3rem;
}
button {
  width: 2rem;
  height: 0.4rem;
  margin-top: 0.3rem;
  margin-left: 0.35rem;
  border-radius: 0.2rem;
  outline: none;
}
</style>